﻿/**********************************************************************\
* plugin_manager.h
*
*  Created on: 2013-4-10
*      Author: WANG YAN SHUN
*   Copyright: Autel
* Description: 插件管理实现
*
***********************************************************************/

#ifndef __PLUGIN_MANAGER_H__
#define __PLUGIN_MANAGER_H__


#include "IPlugin.h"

#include <unordered_map>
#include <mutex>


class PluginManager
{
public:
	PluginManager();
	virtual ~PluginManager();

public:
	static PluginManager* getInstance();

public:
	bool loadPlugins();
	void dispatch(std::shared_ptr<Msg> msg);

private:
	static PluginManager* m_instance;

private:
	//std::unordered_map<AUTEL_MESSAGE, IPlugin*> m_pluginMap;
	std::unordered_map<uint16_t, IPlugin*> m_pluginMap;

};


#endif /* __PLUGIN_MANAGER_H__ */
